import request from "@/utils/request";

//查询地区列表
export function listArea(query) {
  return request({
    url: "/zk/area/list",
    method: "get",
    params: query,
  });
}

//新增地区
export function addArea(data) {
  return request({
    url: "/zk/area",
    method: "post",
    data: data,
  });
}

//获取详细信息
export function getArea(num) {
  return request({
    url: "/zk/area/" + num,
    method: "get",
  });
}

//排除当前节点
export function listAreaExcludeChild(num) {
  return request({
    url: "/zk/area/list/exclude/" + num,
    method: "get",
  });
}

export function updateArea(data) {
  return request({
    url: "/zk/area/",
    method: "put",
    data: data,
  });
}

export function deleteArea (num) { 
  return request({
    url: "/zk/area/" + num,
    method: "delete"
  })
}

export function setAreaByAncestorsIsNull() {
  return request({
    url: "/zk/area/setAreaByAncestorsIsNull",
    method: "put"
  });
}
